<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>创建XMLhttpRequest对象，兼容IE7之前和主流浏览器</title>
</head>
<body>
  <h1>实例化xhr对象</h1>
  <script src="xhr.js"></script>
  <script>
    var xhr = getXhr()
    alert(xhr)
  </script>
</body>
</html>